import 'package:coinbaby/common/appbar/appbar.dart';
import 'package:coinbaby/common/const/cosnt.dart';
import 'package:coinbaby/common/textstyle/textstyle.dart';
import 'package:coinbaby/page/autobuy/view/auto_banner.dart';
import 'package:coinbaby/page/autobuy/view/bottom_buttom.dart';
import 'package:flutter/material.dart';

class StrategyPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    final size = MediaQuery.of(context).size;

    return Scaffold(
      backgroundColor: Colors.white,
      appBar: NormalAppbar.normal(
        title: Text("1策略"),
        color: Colors.white, 
        elevation: 0,
        onPress: () => Navigator.pop(context)
      ),
      body: Column(
        children: <Widget>[
          Center(
            child: Padding(
              padding: const EdgeInsets.only(bottom: 10.0),
              child: Image.asset("assets/icon_huobi2.png"),
            ),
          ),
          Container(
            height: size.height * 0.22,
            padding: const EdgeInsets.symmetric(horizontal: 15),
            child: AutoBannerView(),
          ),
          Expanded(
            child: GridView.builder(
            itemCount: 4,
            padding: const EdgeInsets.all(15),
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, mainAxisSpacing: 10, crossAxisSpacing: 10, childAspectRatio: 1.2), 
            itemBuilder: (context, index){
              return Column(
                children: <Widget>[
                  Container(
                    height: size.height * 0.13,
                    decoration: BoxDecoration(
                      color: AppColor.divigrey,
                      borderRadius: BorderRadius.circular(10)
                    ),
                  ),
                  SizedBox(height: 10,),
                  Text("特色1", style: AppFont.textStyle(15, AppColor.font333),)
                ],
              );
            }),
          ),
          BottomButton(title: "创建策略", onTap: () => Navigator.pushNamed(context, "/createstrategy"),)
        ],
      ),
    );
  }
}